#
# Created By: Huiyong.Ren 2019/08/01
#
if(WIN32)
    LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lib/Release)
else()
    LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lib)
endif()
add_executable(CybertronRecordParser "")

include_directories("${CYBERTRON_PATH_SOURCE}/CoreLibrary/include")
include_directories("${CYBERTRON_PATH_ROOT}/3rdparty")
include_directories("${CYBERTRON_PATH_SOURCE}/Protocol/Output/cpp")

IF (WIN32)
	add_definitions(-D_WIN32_WINNT=0x0501)
ENDIF()

add_definitions(-DNOMINMAX)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)

file(GLOB_RECURSE srcs *.h *.hh *i *.hpp *.c *.cc *.cpp)
target_sources(CybertronRecordParser PRIVATE ${srcs})
source_group(Source FILES ${srcs})

SetDefaultTargetProperties(CybertronRecordParser)
if (WIN32)
	target_link_libraries(CybertronRecordParser advapi32
	       iphlpapi
	       psapi
	       shell32
	       user32
	       userenv
	       ws2_32
	       crypt32    #for libcurl
	       Wldap32    #for libcurl
	       Normaliz   #for libcurl
		   pdh # for pdh_util/query.cpp
	       ${CYBERTRON_PATH_ROOT}/3rdparty/libcurl/lib_win_x64/libcurl_a.lib)
else()
	target_link_libraries(CybertronRecordParser pthread)
	target_link_libraries(CybertronRecordParser rt)
endif()

target_link_libraries(CybertronRecordParser CybertronCore)

IF (MSVC)
target_link_libraries(CybertronRecordParser protobuf)
ELSEIF (UNIX)
target_link_libraries(CybertronRecordParser protobuf -luuid)
ENDIF()

IF (MSVC)
	SET_PROPERTY(TARGET CybertronRecordParser PROPERTY FOLDER "Tool")
ENDIF()
